import {
  Controller,
  Get,
  Post,
  Body,
  Req,
  SetMetadata,
  UsePipes,
  ValidationPipe,
  Param,
  Query,
} from '@nestjs/common';
import { ExerciseDto, MuscleDto } from './muscle.dto';
import { ExerciseService, MuscleService } from './muscle.service';
import { ADMIN_PREFIX } from '@/app/admin/admin.constants';
@SetMetadata('isLogger', true)
@Controller()
export class MuscleController {
  constructor(private readonly muscleService: MuscleService) {}

  @Get('/getMuscleList')
  getMuscleList(
    @Query()
    params: {
      pageIndex: number;
      pageSize: number;
      title: string;
      parent_id: string;
    },
  ) {
    return this.muscleService.getMuscleList(params);
  }

  @Post('/muscleDelete')
  muscleDelete(@Body('ids') ids: string[]) {
    console.log('ids',ids);
    return this.muscleService.muscleDelete(ids);
  }

  @Post('/muscleUpdate')
  muscleUpdate(@Body() muscleDto: MuscleDto) {
    return this.muscleService.muscleUpdate(muscleDto);
  }

  @Post('/muscleAdd')
  muscleAdd(@Body() muscleDto: MuscleDto) {
    return this.muscleService.muscleAdd(muscleDto);
  }
}
